import *as types from '../actions/types'

const default_state = {
    data: [],
    loading: false
}

const correcting_classroom = (state = default_state, action) => {
    switch(action.type) {
        case types.FETCHING_CORRECTING_CLASSROOM:
            return {
                ...state,
                data: [],
                loading: true
            }
        case types.FETCHED_CORRECTING_CLASSROOM:
            return {
                ...state,
                data: action.data,
                loading: false
            } 
        default:
            return default_state   
    }
}

export default correcting_classroom